Skip to content

Conversation

@fazzatti
Copy link
Owner

@fazzatti fazzatti commented Dec 8, 2025

This pull request refactors various type guard and signer-related utilities throughout the codebase for improved clarity and maintainability. The main changes include replacing the TransactionSigner type with a more general Signer type, consolidating and renaming type guard functions from the verifiers directory to a new type-guards directory, and updating all relevant imports and usages. This update also introduces a new utility for checking if an object has a function property, and removes legacy code.

Type guard and signer refactoring:

  • Replaced all usages and type definitions of TransactionSigner with the new, more general Signer type in files such as core/account/native/index.ts, core/account/native/types.ts, core/common/types/transaction-config/types.ts, and related test and implementation files. [1] [2] [3] [4] [5] [6] [7] [8] [9]
  • Added a new isSigner type guard in core/common/type-guards/is-signer.ts to robustly check for Signer objects, and removed the legacy is-transaction-signer.ts. [1] [2]

Type guard utilities consolidation:

  • Moved all type guard functions from core/common/verifiers/ to core/common/type-guards/, updated their names and imports, and removed the old verifiers exports. [1] [2] [3] [4] [5]
  • Updated all import paths in affected files and tests to use the new type-guards location and naming. [1] [2] [3]

Utility additions:

  • Added a new utility function hasFunction in core/common/type-guards/has-function.ts to check if an object has a specified function property.
  • Improved the isDefined utility to check for both undefined and null values.

Versioning:

  • Bumped the package version to 0.13.0 in core/deno.json to reflect these breaking changes.

…uthEntry functions for SorobanAuthorizationEntry handling
fazzatti and others added 27 commits November 27, 2025 13:48
* feat(wip) add sac client

* feat(wip): implement SAC error handling and contract methods

* feat: rename SEP-11 asset functions and types to StellarAssetCanonicalString

* feat: add unit tests for StellarAssetContract deployment error handling

- Implement unit tests for StellarAssetContract's deploy method to ensure proper error handling for various scenarios, including non-SIMULATION_FAILED errors and malformed simulation responses.
- Refactor asset-related imports to use StellarAssetCanonicalString instead of SEP11Asset across multiple event standards.
- Update contract integration tests to instantiate Contract using the new constructor method.
- Remove unused Asset import from contract error handling.
- Clean up commented-out code related to asset wrapping in contract integration tests.

* fix: correct import paths in unit tests for StellarAsset and ScVal

* test: add missing tests for MintEvent and TransferEvent validation scenarios

* chore: update version to 0.11.0 in deno.json
@fazzatti fazzatti self-assigned this Dec 8, 2025
@fazzatti fazzatti merged commit d0af94e into main Dec 8, 2025
2 checks passed
@codecov
Copy link

codecov bot commented Dec 8, 2025

Codecov Report

❌ Patch coverage is 89.75904% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 99.10%. Comparing base (370780c) to head (0777adb).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
core/common/type-guards/is-signer.ts 18.18% 9 Missing ⚠️
core/common/type-guards/has-function.ts 0.00% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #48      +/-   ##
==========================================
+ Coverage   99.01%   99.10%   +0.09%     
==========================================
  Files         144      147       +3     
  Lines        7175     7285     +110     
  Branches      732      733       +1     
==========================================
+ Hits         7104     7220     +116     
+ Misses         71       65       -6     
Flag Coverage Δ
unittests 99.10% <89.75%> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
core/account/native/index.ts 100.00% <100.00%> (ø)
core/asset/sac/index.ts 100.00% <100.00%> (ø)
core/common/index.ts 100.00% <100.00%> (ø)
core/common/type-guards/index.ts 100.00% <100.00%> (ø)
core/common/type-guards/is-defined.ts 100.00% <100.00%> (ø)
core/common/type-guards/is-fee-bump-transaction.ts 100.00% <ø> (ø)
core/common/type-guards/is-muxed-id.ts 100.00% <ø> (ø)
core/common/type-guards/is-signing-threshold.ts 100.00% <ø> (ø)
...ommon/type-guards/is-smart-contract-transaction.ts 100.00% <100.00%> (ø)
core/common/type-guards/is-transaction.ts 100.00% <ø> (ø)
... and 15 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants